package com.lagou.order.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lagou.common.pojo.Orders;
import com.lagou.order.mapper.OrderMapper;
import com.lagou.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public Orders queryById(Integer id) {
        return orderMapper.selectById(id);
    }

    @Override
    public List<Orders> queryAll() {
        IPage<Orders> page = new Page<>(0,10);
        page = orderMapper.selectPage(page,null);
        return page.getRecords();
    }
}
